package com.slz3.business.module.memberManagement.drawTicket.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.drawTicket.domain.DrawTicket;
import com.slz3.business.module.memberManagement.drawTicket.domain.DrawTicketCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class DrawTicketResAtomic extends DrawTicketResExecutor {

    public Mono<ServerResponse> add_$DrawTicketUpdateLock(ServerRequest req, DrawTicket drawTicket) {
        return DrawTicketResSafeValid.add(req, drawTicket) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.add(req, drawTicket);
    }

    public Mono<ServerResponse> delete_$DrawTicketUpdateLock(ServerRequest req, DrawTicketCondition drawTicketCondition) {
        return DrawTicketResSafeValid.delete(req, drawTicketCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.delete(req);
    }

    public Mono<ServerResponse> modify_$DrawTicketUpdateLock(ServerRequest req, DrawTicket drawTicket) {
        return DrawTicketResSafeValid.modify(req, drawTicket) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.modify(req, drawTicket);
    }

    public Mono<ServerResponse> info_$DrawTicketUpdateLock(ServerRequest req) {
        return DrawTicketResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$DrawTicketUpdateLock(ServerRequest req, DrawTicketCondition drawTicketCondition) {
        return DrawTicketResSafeValid.auditSubmit(req, drawTicketCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$DrawTicketUpdateLock(ServerRequest req, DrawTicketCondition drawTicketCondition) {
        return DrawTicketResSafeValid.audit(req, drawTicketCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.audit(req);
    }

    public Mono<ServerResponse> auditReject_$DrawTicketUpdateLock(ServerRequest req, DrawTicketCondition drawTicketCondition) {
        return DrawTicketResSafeValid.auditReject(req, drawTicketCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$DrawTicketUpdateLock(ServerRequest req, DrawTicketCondition drawTicketCondition) {
        return DrawTicketResSafeValid.usingEnable(req, drawTicketCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$DrawTicketUpdateLock(ServerRequest req, DrawTicketCondition drawTicketCondition) {
        return DrawTicketResSafeValid.usingDisable(req, drawTicketCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                super.usingDisable(req);
    }
}
